package apitest

import (
	"fmt"
	"log"

	"github.com/tencent-connect/botgo/dto"
	"github.com/tencent-connect/botgo/openapi"
)

// 获取当前用户信息
func Me(api openapi.OpenAPI) {
	user, meError := api.Me(ctx)
	if meError != nil {
		log.Fatalln("调用 Me 接口失败, err = ", meError)
	}
	fmt.Println(user)
}

// 获取当前用户频道列表
func MeGuilds(api openapi.OpenAPI) {
	guilds, meGuildError := api.MeGuilds(ctx, &dto.GuildPager{})
	if meGuildError != nil {
		log.Fatalln("调用 MeGuild 接口失败, err = ", meGuildError)
	}
	for i, guild := range guilds {
		fmt.Println(i, guild)
	}
}
